<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .test {
            height: 100px;
            width: 100px;
            background: #000;


        }

        .outer {
            height: 400px;
            width: 400px;
            background: red;
            display: grid;
            align-items: center;
            justify-content: center;
        }
    </style>
</head>
<body>
<div class="outer">
    <div class="test">
    </div>
</div>

</body>
</html>